<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TMCStepper: src/source/SERIAL_SWITCH.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">TMCStepper
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('_s_e_r_i_a_l___s_w_i_t_c_h_8cpp_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">SERIAL_SWITCH.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_s_e_r_i_a_l___s_w_i_t_c_h_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_s_e_r_i_a_l___s_w_i_t_c_h_8h.html">SERIAL_SWITCH.h</a>&quot;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160; </div>
<div class="line"><a name="l00003"></a><span class="lineno"><a class="line" href="class_s_switch.html#a910f9f90a4c43e8b05a8c69ee0be9b94">    3</a></span>&#160;<a class="code" href="class_s_switch.html#a910f9f90a4c43e8b05a8c69ee0be9b94">SSwitch::SSwitch</a>( <span class="keyword">const</span> uint16_t pin1, <span class="keyword">const</span> uint16_t pin2, <span class="keyword">const</span> uint8_t address) :</div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;  p1(pin1),</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;  p2(pin2),</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;  addr(address)</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;    {</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;        pinMode(pin1, OUTPUT);      </div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;    pinMode(pin2, OUTPUT);</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;    }</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160; </div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="class_s_switch.html#a6ff09d0850d551571dc333fb74ff8628">   12</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_s_switch.html#a6ff09d0850d551571dc333fb74ff8628">SSwitch::active</a>() {</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;  digitalWrite(p1, addr &amp; 0b01 ? HIGH : LOW);</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;  digitalWrite(p2, addr &amp; 0b10 ? HIGH : LOW);</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aclass_s_switch_html_a910f9f90a4c43e8b05a8c69ee0be9b94"><div class="ttname"><a href="class_s_switch.html#a910f9f90a4c43e8b05a8c69ee0be9b94">SSwitch::SSwitch</a></div><div class="ttdeci">SSwitch(const uint16_t pin1, const uint16_t pin2, const uint8_t address)</div><div class="ttdef"><b>Definition:</b> <a href="_s_e_r_i_a_l___s_w_i_t_c_h_8cpp_source.html#l00003">SERIAL_SWITCH.cpp:3</a></div></div>
<div class="ttc" id="aclass_s_switch_html_a6ff09d0850d551571dc333fb74ff8628"><div class="ttname"><a href="class_s_switch.html#a6ff09d0850d551571dc333fb74ff8628">SSwitch::active</a></div><div class="ttdeci">void active()</div><div class="ttdef"><b>Definition:</b> <a href="_s_e_r_i_a_l___s_w_i_t_c_h_8cpp_source.html#l00012">SERIAL_SWITCH.cpp:12</a></div></div>
<div class="ttc" id="a_s_e_r_i_a_l___s_w_i_t_c_h_8h_html"><div class="ttname"><a href="_s_e_r_i_a_l___s_w_i_t_c_h_8h.html">SERIAL_SWITCH.h</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_94e7a0fbe7f8eaf7f05ee7b02c647e9f.html">source</a></li><li class="navelem"><a class="el" href="_s_e_r_i_a_l___s_w_i_t_c_h_8cpp.html">SERIAL_SWITCH.cpp</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
